package team.seekers.hula.island.post.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import team.seekers.hula.common.annotation.ApiResponseBody;
import team.seekers.hula.common.entity.PageResult;
import team.seekers.hula.common.entity.VisibilityUpdateDTO;
import team.seekers.hula.island.post.entity.dto.IslandPostPageDTO;
import team.seekers.hula.island.post.entity.dto.IslandPostManageUpdateDTO;
import team.seekers.hula.island.post.entity.vo.IslandPostListVO;
import team.seekers.hula.island.post.entity.vo.IslandPostManageListVO;
import team.seekers.hula.island.post.service.IslandPostManageService;

import javax.annotation.Resource;

/**
 * @author ekin
 * @Description GOOD
 * @mood happy
 */
@Controller
@ApiResponseBody
@RequestMapping("/manage/post")
public class PostManageController {

    @Resource
    private IslandPostManageService islandPostManageService;

    /**
     *
     * 浪屿帖子管理
     */
    @GetMapping("/page")
    public PageResult<IslandPostManageListVO> pagePost(IslandPostPageDTO islandPostPageDTO) {
        return islandPostManageService.pagePost(islandPostPageDTO);
    }

    @PostMapping("/update/visibility")
    public void updateVisibility(@RequestBody VisibilityUpdateDTO updateDTO){
        islandPostManageService.updateVisibility(updateDTO);
    }

}
